package chapter.second.item3;

//多线程调用共有方法会每个线程返回一个实例
public class Singleton2 {
	private static final Singleton2 INSTANCE = new Singleton2();
	
	private Singleton2(){
		
	}
	
	public static Singleton2 getInstance(){
		return INSTANCE;
	}
	
	public void someMethod(){
		//...
	}
	//避免每次反序列化一个序列化的实例时，都会创建一个新的实例
	private Object readSolve(){
		return INSTANCE;
	}
	
}
